package com.heer.gymnasium.widget;

import android.content.Context;
import android.view.View;
import android.widget.Checkable;
import android.widget.FrameLayout;
import android.widget.RadioButton;
import android.widget.TextView;

import com.heer.gymnasium.R;

/**
 * Created by heer on 17/4/23.
 */

public class RechargeSelectView extends FrameLayout implements Checkable {

    private TextView tvOffer;
    private TextView tvDiscount;
    private RadioButton radioPackage;


    public RechargeSelectView(Context context) {
        super(context);
        View.inflate(context, R.layout.item_recharge_offer, this);
        tvOffer = (TextView) findViewById(R.id.tv_offer);
        tvDiscount = (TextView) findViewById(R.id.tv_discount);
        radioPackage = (RadioButton) findViewById(R.id.radio_package);
    }

    public void setText(String text) {
        radioPackage.setText(text);
    }

    public void setOffer(String text) {
        tvOffer.setText(text);
    }

    public void setDiscount(String text) {
        tvDiscount.setText(text);
    }

    @Override
    public void setChecked(boolean checked) {
        radioPackage.setChecked(checked);
    }

    @Override
    public boolean isChecked() {
        return radioPackage.isChecked();
    }

    @Override
    public void toggle() {
        radioPackage.toggle();
    }
}